import socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.bind(('localhost', 9000))

while 1:
    data, addr = s.recvfrom(1024)
    print(f'收到来自：[{addr}] ，数据：{data.decode()}')
    s.sendto(data.decode().upper().encode(), addr)